home *** CD-ROM | disk | FTP | other *** search
- //////////////////////////////////////////////////////////////////////
- // Pocket PC Game Programming
- // Chapter 9: Sprites and Animation
- //
- // CAnimSprite Header File
- //
- // This file includes the CAnimSprite class definition.
- //
- //////////////////////////////////////////////////////////////////////
-
- #pragma once
-
- #include "stdafx.h"
- #include "CSprite.h"
-
- #define NUM_FRAMES 16
-
- class CAnimSprite: public CSprite
- {
- private:
- //CBitmap *source;
- CBitmap *sprites[NUM_FRAMES];
- int iCurFrame, iTotalFrames;
- int iWidth, iHeight;
-
- HBITMAP hUnder;
- HDC hdcUnder;
-
- public:
-
- CAnimSprite(HDC hdc);
- virtual ~CAnimSprite();
- BOOL LoadTile(int iTileNum, LPTSTR lpFilename, int iWidth, int iHeight);
- BOOL LoadAnimSeq(int iStartCol, int iNumFrames, int iRow, LPTSTR lpFilename, int iWidth, int iHeight);
-
- virtual BOOL BitBlit();
- virtual BOOL StretchBlit(int dx, int dy);
- virtual BOOL TransBlit(COLORREF clrTrans);
-
- int ImageWidth() { return iWidth; };
- int ImageHeight() { return iHeight; };
- void SetImageSize(int iImgWidth, int iImgHeight);
-
- void SetFrame(int iFrame);
- int GetFrame() { return iCurFrame; };
- void NextFrame();
- void PrevFrame();
- };
-
-
-